import 'package:TestTool/web.dart';
import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final TextEditingController _controller = TextEditingController(text: 'https://afraid-squid-13.loca.lt/#/preference/mine?stack-key=de87da73');
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text('输入地址'),
      ),
      body: Container(
        padding: EdgeInsets.fromLTRB(10, 20, 10, 10),
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.all(5),
              height: 200,
              decoration: BoxDecoration(
                border: Border.all(
                  color: Colors.red,
                  width: 1,
                ),
              ),
              child: TextField(
                controller: _controller,
                decoration: InputDecoration(hintText: '输入....'),
              ),
            ),
            Container(
              padding: EdgeInsets.only(top: 20),
              child: InkWell(
                onTap: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => WebPage(
                        url: _controller.text,
                      ),
                    ),
                  );
                },
                child: Container(
                  color: Colors.blue,
                  height: 60,
                  child: Text(
                    '跳转加载',
                    style: TextStyle(),
                  ),
                  alignment: Alignment.center,
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
